<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>JSON属性访问</title>
    <script type="text/javascript">
        var stu = {
            name: "zhangsan",
            age: "18",
            print: function () {
                return "学生的姓名是" + this.name + "，年龄是" + this.age + "。";
            }
        }
        console.log(stu.name);
        console.log(stu.age);
        console.log(stu.age2);
        console.log(stu.print());
        stu["school"]="pzhu";
        console.log(stu.school)
    </script>
</head>
<body>

</body>
</html>